package com.dominator.repository;

import com.dominFramework.core.dao.SqlDao;
import com.dominFramework.core.typewrap.Dto;
import com.dominFramework.core.typewrap.Dtos;
import com.dominator.mybatis.dao.T_wc2018_teamPO;
import com.dominator.utils.dao.JdbcHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository
public class DaoTeam {
    @Resource
    JdbcHelper jh;


    @Autowired
    SqlDao sqlDao;


    public T_wc2018_teamPO selectByUserId(String userId) {
        Dto qDto = Dtos.newDto("user_id", userId);
        T_wc2018_teamPO row = (T_wc2018_teamPO) sqlDao.selectOne("Team.selectByUserId", qDto);
        return row;
    }


    public List<Dto> getRankList(Dto dto) {
        return sqlDao.list("Team.getRankList", dto);
    }

    public List<Dto> getMyRankList(Dto dto) {
        return sqlDao.list("Team.getMyRankList", dto);
    }


    public List<Dto> getTeamRateList(String userId) {
        Dto qDto = Dtos.newDto("user_id", userId);
        return sqlDao.list("Team.getTeamRateList", qDto);
    }

    public Dto getMyTeam(Dto dto) {
        return sqlDao.selectDto("Team.getMyTeam", dto);
    }

    public List<Dto> getMyTeamMemberRate(Dto dto) {
        return sqlDao.list("Team.getMyTeamMemberRate", dto);
    }
}

